//
//  PublicDefine.h
//  码上用卡圈
//
//  Created by Pro on 2018/05/11.
//  Copyright © 2017年 congliu. All rights reserved.
//

#ifndef PublicDefine_h
#define PublicDefine_h

#define pageSize 10
//保存当前版本号，用来判断是否显示新特性页面
#define LCVersionKey @"AppVersion"
//用卡服务号通知键值
#define LCBlackTechKey @"LCBlackTechKey"
#define LCPlaceHolderBTMsg @"全网首发海量元气干货"
//小道消息键值
#define LCPushKey @"LCPushKey"
#define LCPlaceHolderPushMsg @"不为人知的内部消息"
//是否同意用户协议
#define LCAgremmentKey @"LCAgremmentKey"
//是否设置角色key
#define LCRoleSelectKey @"LCRoleSelectKey"
//本地数据库操作
#define lcDBOperation [LCFMDB shareDatabase]
//最近一次添加好友时间
#define LCAddFriendTimeKey @"LCAddFriendTimeKey"
//当前登录用户
#define kLoginUser @"kLoginUser"
//当前支付宝账号
#define HWAiPayCount @"hwAiPayCount"
#define HWAiPayName @"hwAiPayName"

//获取好友限制
#define kGetFriendLimit 500
//获取分组限制
#define kGetFriendGroupLimit 8
//通讯录地址后缀
#define kAdressBookPath @"AdressBookList.plist"
//占位图
#define kPlaceholderBigImg @"zhanwei_big"
#define kPlaceholderMenuImg @"zhanwei_middle"
#define kPlaceholderSmallImg @"zhanwei_small"

#define IFNULL(a, b) (a == [NSNull null] || a == nil ? b : a)

#define LCUserDefaultsSet(value, key) [[NSUserDefaults standardUserDefaults] setValue:value forKey:key]
#define LCUserDefaultsGet(key) [[NSUserDefaults standardUserDefaults] valueForKey:key]


#define KeyedUnarchiver(data) [NSKeyedUnarchiver unarchiveObjectWithData:data]
#define KeyedArchiver(data) [NSKeyedArchiver archivedDataWithRootObject:data]
#define CHATTINGSQLITE @"IM.sqlite"
#define DefaultContext  [NSManagedObjectContext MR_newPrivateQueueContext]
#define SavaData [DefaultContext MR_saveToPersistentStoreAndWait];

#define PGYSDKKEY @"9ff8dc591ebd0a5c01d5e22a5fc6004d"
//登陆管理类
#define loginManager [LCLoginManager manager]

#define kOrderCellHeight 40.f
///Fonts
#define kFontOfSize(fontSize) [UIFont fontWithName:@"STHeitiSC-Light" size:fontSize]
#define kFontOfSizeBold(fontSize) [UIFont fontWithName:@"STHeitiSC-Medium" size:fontSize]
#define kFontOfSizeBolds(fontSize)  [UIFont fontWithName:@"Helvetica-Bold" size:fontSize]

#define kSystemFontOfSize(size)  [UIFont systemFontOfSize:size]

#define lc_image(imgName) [UIImage imageNamed:imgName]
#define lc_imageWithData(data) [UIImage imageWithData:data]

#define lc_imageWithFile(imgName,imgType)   [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:[NSString stringWithFormat:@"%@",imgName] ofType:[NSString stringWithFormat:@"%@",imgType]]]

#define lc_imageForAssets(imgName)   [UIImage imageWithContentsOfFile:[NSURL fileURLWithPath:[]]]

#define zbx_BtnSetHightLightedBgImg(btn,imgName)[btn setBackgroundImage:[UIImage imageNamed:imgName] forState:UIControlStateHighlighted]

#define zbx_BtnSetSelectedBgImg(btn,imgName) [btn setBackgroundImage:[UIImage imageNamed:imgName] forState:UIControlStateSelected]

#define zbx_BtnSetNormalBgImg(btn,imgName)     [btn setBackgroundImage:[UIImage imageNamed:imgName] forState:UIControlStateNormal]

#define KScreenWidth [UIScreen mainScreen].bounds.size.width
#define KScreenHeight  [UIScreen mainScreen].bounds.size.height
//导航条高度
#define kNavgationBarHeight self.navigationController.navigationBar.frame.size.height
//状态栏高度
#define  kStatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height

#define kTabbarHeight 49.f

//commonCell height
#define kButtonCornerRedius 5.0f
#define kCommonCellHeight 50.f
#define kGroupTableSectionHeaderHeight 0.5f
#define kLineHeight 0.5f
#define kScrollViewHeiht 150.f
#define kUserHeadIconHeight 80.f

#define LCWeakSelf(weakSelf)  __weak __typeof(&*self)weakSelf = self;
#define LCStrongSelf(weakSelf)  __weak __typeof(&*self)weakSelf = self;

#define LCStrongly(type)  __strong typeof(type) type = weak##type

#define LCWeakly(type)  __weak typeof(type) type = weak##type

//App版本号
#define appVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]

//一些缩写
#define kApplication        [UIApplication sharedApplication]
#define kKeyWindow          [UIApplication sharedApplication].keyWindow
#define kUserDefaults       [NSUserDefaults standardUserDefaults]
#define kNotificationCenter [NSNotificationCenter defaultCenter]

#define DISMISS_SVP(time) \
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ \
[SVProgressHUD dismiss]; \
});

//正常文字颜色，稍深
#define kColorTextDetailDeeper [UIColor colorWithRed:49/255.0 green:49/255.0 blue:49/255.0 alpha:1.0]

//占位符颜色
#define kColorTextPlaceHolder [UIColor colorWithRed:199/255.0 green:199/255.0 blue:199/255.0 alpha:1.0]
//Table中栏位名称
#define kColorCellTitle [UIColor colorWithRed:33/255.0 green:33/255.0 blue:33/255.0 alpha:1.0]
//Table中栏位内容
#define kColorCellDetail [UIColor colorWithRed:112/255.0 green:112/255.0 blue:112/255.0 alpha:1.0]

#define WhiteColor [UIColor whiteColor]

#define BlackColor [UIColor blackColor]

#define OrangeColor [UIColor orangeColor]

#define kBtnOrange ZBXCOLOR(255, 154,65, 1)

#define kBtnGreen  [UIColor greenColor]

#define ZBXCOLOR(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]

#define kBtnRed  [Utilties colorWithHexString:@"f74c31"]
#define themeColor [Utilties colorWithHexString:@"508dff"]

#endif /* PublicDefine_h */
